package com.example.demo.Controller;

import com.example.demo.Dao.OrderDao;
import com.example.demo.Entity.OrderEntity;
import com.example.demo.Entity.ResultEntity;
import com.example.demo.Entity.RiderEntity;
import com.example.demo.Service.RiderService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/order")
@CrossOrigin
public class OrderController {
    @Resource
    OrderDao orderDao;

    @RequestMapping(value = "/getOrderInfo")
    public ResultEntity GetRider() {
        List<OrderEntity> orderEntities;
        orderEntities = orderDao.get();

        ResultEntity res = new ResultEntity();
        res.setCode(20000);
        res.setData(orderEntities);
        return res;
    }
}
